package com.agou.app.admin.enums;

import com.agou.core.enums.IEnum;

/**
 * 用户安全类型
 * 
 * @author agou
 * 
 */
public enum EnAdminUserSecurityType implements IEnum {
	Password("密码", 1), Certificate("证书", 2);
	// 成员变量
	private String enumName;
	private int enumCode;
	
	// 普通方法
	public static String getEnumName(int code) {
		for (EnAdminUserSecurityType c : EnAdminUserSecurityType.values()) {
			if (c.getCode() == code) {
				return c.getName();
			}
		}
		return null;
	}
	
	public static EnAdminUserSecurityType getEnum(int code) {
		for (EnAdminUserSecurityType c : EnAdminUserSecurityType.values()) {
			if (c.getCode() == code) {
				return c;
			}
		}
		return null;
	}

	// 构造方法
	private EnAdminUserSecurityType(String name, int code) {
		this.enumName = name;
		this.enumCode = code;
	}

	public String getName() {
		return enumName;
	}

	public int getCode() {
		return enumCode;
	}

	
}
